package com.thinta.wind.ui.main

import androidx.databinding.ViewDataBinding
import androidx.lifecycle.ViewModelProvider
import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.ui.setupWithNavController
import com.google.android.material.bottomnavigation.BottomNavigationView
import com.google.android.material.bottomnavigation.LabelVisibilityMode
import com.thinta.wind.R
import com.thinta.wind.base.BaseActivity
import com.thinta.wind.base.BaseModel
import com.thinta.wind.base.ViewModelFactory
import kotlinx.android.synthetic.main.activity_main.*


class MainActivity : BaseActivity<BaseModel, ViewDataBinding>() {

    override fun viewModelClass() = BaseModel::class.java

    override fun startListenerData() {

    }

    override fun initView() {
        val navHostFragment =
            supportFragmentManager.findFragmentById(R.id.fragment_layout) as NavHostFragment
        val navController = navHostFragment.navController
        findViewById<BottomNavigationView>(R.id.bottom_bar)
            .setupWithNavController(navController)
        bottom_bar.labelVisibilityMode = LabelVisibilityMode.LABEL_VISIBILITY_LABELED
    }

    override fun getLayoutRes() = R.layout.activity_main

    override fun getModelFactory(): ViewModelProvider.NewInstanceFactory = ViewModelFactory()
}
